<template>
  <div>
    <ListItem>
      <div>选择使用场景</div>
      <a-select
        v-model:value="textConfig.type"
        size="small"
        :options="textTypeList"
        buttonStyle="solid"
        optionType="button"
        style="width: 200px;"
        @change="selectStage"
      ></a-select>
    </ListItem>
    <div class="flex flex-col gr-2 mt-2" v-if="textConfig.type === 'number'">
      <ListItem>
        <div>最大值</div>
        <div>
          <a-input placeholder="最大值" size="small" v-model:value="textConfig.min"></a-input>
        </div>
      </ListItem>
      <ListItem>
        <div>最小值</div>
        <div>
          <a-input placeholder="最小值" size="small" v-model:value="textConfig.max"></a-input>
        </div>
      </ListItem>
    </div>
  </div>
</template>

<script setup lang="ts">
import { setProp, treeBus } from "@/views/bus/treeData";
import { computed, onMounted, ref } from "vue";
import ListItem from "@/views/components/InListItem.vue";
import { textTypeList } from "@/data/config";
const selectItemConfig = computed(() => {
  return treeBus.selectItem;
});
const textConfig = computed(() => {
  return selectItemConfig.value.config.text;
});
const selectStage = () => {
  setProp(treeBus.selectItem);
};
</script>

<style lang="scss" scoped></style>
